package cn.stylefeng.guns.modular.account.service;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.account.entity.Account;
import cn.stylefeng.guns.modular.account.model.params.AccountParam;
import cn.stylefeng.guns.modular.account.model.result.AccountResult;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 账户表 服务类
 * </p>
 *
 * @author liuqiang
 * @since 2020-02-10
 */
public interface AccountService extends IService<Account> {

    /**
     * 新增
     *
     * @author liuqiang
     * @Date 2020-02-10
     */
    void add(AccountParam param);

    /**
     * 删除
     *
     * @author liuqiang
     * @Date 2020-02-10
     */
    void delete(AccountParam param);

    /**
     * 更新
     *
     * @author liuqiang
     * @Date 2020-02-10
     */
    void update(AccountParam param);

    /**
     * 查询单条数据，Specification模式
     *
     * @author liuqiang
     * @Date 2020-02-10
     */
    AccountResult findBySpec(AccountParam param);

    /**
     * 查询列表，Specification模式
     *
     * @author liuqiang
     * @Date 2020-02-10
     */
    List<AccountResult> findListBySpec(AccountParam param);

    /**
     * 查询分页数据，Specification模式
     *
     * @author liuqiang
     * @Date 2020-02-10
     */
     LayuiPageInfo findPageBySpec(AccountParam param);

    LayuiPageInfo findPageRemindList(AccountParam param);


    AccountResult getByPhone(String phone);

    void deductByPhone(String phone, BigDecimal totalPrice);

    void addByPhone(String phone, BigDecimal amount);

    BigDecimal updateByPhone(String mobile, BigDecimal totalPrice, Integer start_time);

    LayuiPageInfo statistic(AccountParam accountParam);
}
